const express = require('express')
const cors = require('cors')
const router = require('./router')
// const departListRouter = require('./models/depart')
// const budgetCourseListRouter = require('./models/budgetCourse')
// const yearBudgetListRouter = require('./models/yearBudget')
// const departYearBudgetListRouter = require('./models/departYearBudget')
// const budgetYearCourseValueListRouter = require('./models/budgetYearCourseValue')
const app = express()
app.use(cors())
app.use(express.json())
app.use(express.urlencoded())

// app.use('/departList',departListRouter)
app.use('/',router)
// app.use('/budgetCourseManage',budgetCourseListRouter)
// app.use('/yearBudgetManage',yearBudgetListRouter)
// app.use('/departYearBudgetManage',departYearBudgetListRouter)
// app.use('/departYearBudgetValueManage',budgetYearCourseValueListRouter)

app.use((err,req,res,next)=>{
    res.status(500).json({
        error:err
    })
})
app.listen(3000,()=>{console.log(`http://127.0.0.1:3000`);})